<template>
  <div id="topSearch">
    <div class="search-box">
      <el-form
        ref="dictForm"
        :inline="true"
        :model="formInline"
        class="demo-form-inline"
        @submit.native.prevent
      >
        <el-form-item label="搜索" prop="name">
          <el-input
            v-model="formInline.name"
            placeholder="请输入规则名称搜索"
          ></el-input>
        </el-form-item>
        <el-form-item class="s-btn">
          <el-button type="success" icon="el-icon-search" @click="toSearch">
            搜索
          </el-button>
          <el-button type="success" plain @click="reset">
            重置
          </el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  name: 'TopSearch',
  msg: '人群管理/创建人群/字典-顶部搜索',
  props: {
    formInline: {
      type: Object,
      default: function() {
        return {
          name: ''
        }
      }
    }
  },
  mounted() {},
  methods: {
    /* 搜索 */
    toSearch() {
      this.$emit('toSearch')
    },
    /* 重置 */
    reset() {
      this.$refs.dictForm.resetFields()
    }
  }
}
</script>

<style lang="less">
#topSearch {
  .search-box {
    padding-left: 30px !important;
  }
}
</style>
